package cn.wolfcode.luowowo.itemshop.service.impl;

import cn.wolfcode.luowowo.itemshop.domain.ItemShopProp;
import cn.wolfcode.luowowo.itemshop.mapper.ItemShopPropMapper;
import cn.wolfcode.luowowo.itemshop.qo.ShopPropQueryObject;
import cn.wolfcode.luowowo.itemshop.service.IItemShopPropService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class ItemShopPropServiceImpl implements IItemShopPropService {

    @Autowired
    private ItemShopPropMapper itemShopPropMapper;


    @Override
    public PageInfo query(ShopPropQueryObject qo) {

        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        return new PageInfo(itemShopPropMapper.selectForList(qo));
    }

    @Override
    public ItemShopProp getById(Long id) {

        if(id != null){
            return itemShopPropMapper.selectByPrimaryKey(id);
        }

        return null;
    }


}
